package com.azure.bigstore.repository;

import com.azure.bigstore.entity.Order;
import com.azure.bigstore.entity.OrderItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import javax.persistence.Tuple;
import java.util.List;
import java.util.Map;

/**
 * Created by liuhuaibin on 2018/1/23.
 */
public interface OrderItemRepoditory extends JpaRepository<OrderItem,Long> {

    @Query(value = "select pid,count(pid) num from t_orderitem group by pid order by num desc limit 60  ",nativeQuery = true)
    List<Object[]> getHot();

    List<OrderItem> findByOid(Long oid);
}
